# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt

import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'stix'
matplotlib.rcParams['font.family'] = 'STIXGeneral'


#%% FONCTION

def f(x, vmax=1,Km=1): #le "C=1", il fait que si tu précises rien, genre "f(3)", il prend par défaut C=1
    
    return vmax*x/(x+Km)


#LISTE DES X
X = np.linspace(0,10,1000) #début, fin, nombre de points

#LISTE DES Y
Y1 = f(X, vmax=1, Km=1)
Y2 = f(X, vmax=1, Km=10)
Y3 = f(X, vmax=1, Km=100)
Y4 = f(X, vmax=1, Km=0.1)
Y5 = f(1/X, vmax=1, Km=1)

#%% GRAPHE

fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111)

ax.set_xlim(0,10) #Limites de l'axe X
ax.set_ylim(0,1) #Limites de l'axe Y

ax.set_xlabel(r'$[S]$', fontsize = 20) #Titre axe X
ax.set_ylabel(r'$v$', fontsize = 20) #Titre axe Y


#ax.plot(X,Y1, label=r'Km = 1', lw=4) #label : nom dans la légende, lw : épaisseur du trait

#ax.plot(X,Y2, label=r'Km = 10', lw=4) #label : nom dans la légende, lw : épaisseur du trait

#ax.plot(X,Y3, label=r'Km = 100', lw=4) 
#ax.plot(X,Y4, label=r'Km = 0,1', lw=4) 

ax.plot(1/X,Y5, label=r'Km = 0,1', lw=4) 

#%% OPTIONNEL

ax.grid(True) #Grille
ax.legend(loc=2 ,prop={'size':15}) #Legende


